package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.vo.CropsVo;
import com.ruoyi.system.api.factory.RemoteFarmerFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 农户服务
 *
 * @author 王泽超的电脑
 */
@FeignClient(contextId = "remoteFarmerService",value = ServiceNameConstants.FARMER_SERVER, fallbackFactory = RemoteFarmerFallbackFactory.class)
public interface RemoteFarmerService {

    /**
     * 修改农产品加工状态
     *
     * @param cropsVo
     * @param source
     * @return
     */
    @PostMapping("/farmer/updateMachingStatus")
    public R<Integer> updateMachingStatus(@RequestBody CropsVo cropsVo,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改农产品填写状态
     *
     * @param cropsId
     * @param source
     * @return
     */
    @GetMapping("/farmer/updateProductWriteStatus/{cropsId}")
    public R<Integer> updateProductWriteStatus(@PathVariable("cropsId") String cropsId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 农产品出库
     *
     * @param cropsId
     * @param source
     * @return
     */
    @GetMapping("/farmer/productOutFactory/{cropsId}")
    public R<Integer> productOutFactory(@PathVariable("cropsId") String cropsId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
